package com.itheima.autoCode.controller;

import cn.hutool.core.util.StrUtil;
import com.itheima.autoCode.dto.CodeContext;
import com.itheima.autoCode.dto.CodeContextFactory;
import com.itheima.autoCode.service.strategy.CodeStyleEnums;
import com.itheima.autoCode.service.strategy.CodeStyleStrategy;
import com.itheima.autoCode.service.strategy.CodeStyleStrategyRegistratar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired CodeStyleStrategyRegistratar styleStrategyRegistratar;

    @GetMapping("/hello")
    public String test(){
        return "hello,world";
    }



    @GetMapping("/hello3")
    public String hello3(){
        CodeStyleStrategy service = styleStrategyRegistratar.findService(CodeStyleEnums.DDD);
        CodeContext codeContext = CodeContextFactory.create();
        service.initProject(codeContext);
        return StrUtil.EMPTY;
    }


}
